package cn.gene.timeyan.article.webapi.mapper;


import cn.gene.timeyan.pojo.article.model.Article;
import cn.gene.timeyan.pojo.article.model.Like;

import cn.gene.timeyan.pojo.article.model.LikeVO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LWG
 * @since 2022-07-25
 */

public interface LikeMapper  {

    LikeVO save(LikeVO likeVO);

    /**

     * 批量保存或修改

     * @param list

     */

    List<LikeVO> saveAll(List list);

    /**

     * 根据被点赞人的id查询点赞列表(即查询都谁给这个人点赞过)

     * @return

     */

    Page<LikeVO> findLikedListByLikedUserIdAndStatus(Long  byUserId, String likeState, Pageable pageable);

    /**

     * 根据点赞人的id查询点赞列表(即查询这个人都给谁点赞过)


     * @return

     */

    Page<LikeVO> findLikedListByLikedPostIdAndStatus(Long  likeId, String likeState, Pageable pageable);

    /**

     * 通过被点赞人和点赞人id查询是否存在点赞记录

     * @return

     */

    LikeVO findByLikedUserIdAndLikedPostId( Long  likeId,Long  byUserId);
}
